<php>if($isReport){</php>
	<span id="TS_report" style="color:red">您已举报</span>
<php>}else{</php>
<div class="pop" id="TS_ReportContent" style="display:none;">
    <div class="con">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr id="f_group">
                <td height="31" id="tishi" style="text-align:left;padding-left:20px;">
			    <strong>举报原因：</strong>
			    	{REPACE_RESEASE}
			    </td>

            </tr>
			    <tr id="f_group">
				<td valign="top">
				{REPACE_TEXTAREA}
			   </td>
				   </tr>
        </table>
    </div>
    <div class="btm" id="f_button">
        <input name="input" type="button" class="btn_b" value="确 定"  onclick="doreport()"/>
        <input name="input2" type="button" class="btn_w" value="取 消" onclick="ymPrompt.close();" />
    </div>
</div>
<span id="TS_report" style="color:blue">
	<a href="javascript:void(0)" onclick="report({$appid},'{$type}','{$url}','{$title}',{$recordId})">{$type}</a>
</span>
<script>
	function report(appid,type,url,info,id){
		
		var reason= '<select id="ts_reasons">';
		var textarea = '<textarea id="ts_con" style="width:90%; height:100px;"></textarea>';
			<volist id="vo" name="reasons">
				reason += "<option value={$vo}>{$vo}</option>";
			</volist>
		reason +="</select>";
		var html = $('#TS_ReportContent').html();
		html = html.replace('{REPACE_RESEASE}',reason);
		html = html.replace('{REPACE_TEXTAREA}',textarea);
		ymPrompt.win(html,400,220,'{$type}')
	}
	
	function doreport(){
		var type = "{$type}";
		var url = "{$url}";
		var info = "{$title}";
		var selectreasons = $("#ts_reasons").val();
		var r_con = $("#ts_con").val();
		var appid = '{$appid}';
		var recordId = '{$recordId}';
        
		if($.trim(r_con)==''){
			alert('说明不能为空');
		}else{
			$.post(TS+"/Public/report",{type:type,url:url,recordId:recordId,info:info,reason:selectreasons,con:r_con,appid:appid},function(txt){
				if(txt){
					alert('举报成功');
					$('#TS_report').html('举报成功');
					ymPrompt.close();
				}else{
					alert("你已经举报过了!");
					ymPrompt.close();
				}
			});
		}
	}
</script>
<php>}</php>


